import React from 'react';
import styles from './form.less';
import { FormContainer } from './FormContainer';
import FormItem from './FormItem';

const Form2 = props => {
    const { required = true, ...otherProps } = props; // required为true和false判断走2套校验规则
    return (
        <>
            <div id="form2" className={styles.title}>
                紧急联系人
            </div>
            <FormContainer>
                <FormItem required={required} type="input" label="姓名" prop="emergencyContact" {...otherProps} />
                <FormItem
                    required={required}
                    type="select"
                    dictCode="emergencyRelationship"
                    label="与本人关系"
                    prop="emergencyRelationship"
                    {...otherProps}
                />
                <FormItem
                    required={required}
                    type="telephone"
                    label="手机号码"
                    prop={['emergencyAreaCode', 'emergencyTelephone']}
                    {...otherProps}
                />
            </FormContainer>
        </>
    );
};

export default Form2;
